/*
 * ========================================================
 * Copyright(c) 2014 杭州偶尔科技-版权所有
 * ========================================================
 * 本软件由杭州偶尔科技所有, 未经书面许可, 任何单位和个人不得以
 * 任何形式复制代码的部分或全部, 并以任何形式传播。
 * 公司网址
 * 
 * 			http://www.kkkd.com/
 * 
 * ========================================================
 */
package com.simon.mengkou.ui.dialog;

import android.app.Activity;

import com.ouertech.android.agm.lib.base.future.core.AgnettyFuture;
import com.ouertech.android.agm.lib.base.future.core.AgnettyResult;
import com.ouertech.android.agm.lib.ui.base.BaseActivity;
import com.ouertech.android.agm.lib.ui.base.BaseDialog;
import com.simon.mengkou.R;
import com.simon.mengkou.future.base.OuerFutureListener;
import com.simon.mengkou.system.global.OuerApplication;


/**
 * @作者 wang rulei
 * @日期 2014-9-10
 * @描述 
 */
public class ExitDialog extends BaseDialog {

	private BaseActivity mActivity;
	
	public ExitDialog(BaseActivity activity) {
		super(activity);
		mActivity = activity;
	}
	
	public ExitDialog(BaseActivity activity, int theme) {
		super(activity, theme);
		mActivity = activity;
	}

	@Override
	protected void initLayout() {
		
	}

	@Override
	protected void initViews() {
		setTitle(R.string.setting_sign_out);
		setMessage(R.string.setting_exit_tips);
		setDouble(R.string.common_confirm, R.string.common_cancel);
		setOnDoubleListener(new OnLeftListener() {
			
			@Override
			public void onLeft() {
				cancel();
				AgnettyFuture future = OuerApplication.mOuerFuture.exitLogin(null);
				mActivity.attachDestroyFutures(future);
			}
		}, new OnRightListener() {
			
			@Override
			public void onRight() {
				cancel();
			}
		});
		
	}


}
